<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        var a = [1, 2, 3];
        var b = [4, 5, 6];
        var c = [7, 8, 9];
        var all = [a, b, c];
        var newArr = [];

        function toResult(arrIndex, aresult) {
            if (arrIndex >= all.length) {
                newArr.push(aresult);
                return;
            };
            var aArr = all[arrIndex];
            if (!aresult) aresult = new Array();
            for (var i = 0; i < aArr.length; i++) {
                var theResult = aresult.slice(0, aresult.length);
                theResult.push(aArr[i]);
                console.log(theResult);
                toResult(arrIndex + 1, theResult);
            }
        }
        toResult(0);
        // console.log(newArr);

        /* 
            次数   arrIndex  aArr  theResult  
            1         0            
        */
    </script>
</body>

</html>